package com.framework.Module.base.schedule;

import com.framework.ACore.ModuleTodo;
import com.framework.Table.Table;
import com.framerock.baselib.Rock;


public class Tableschedule extends Table {

   
    protected void initTable() {
        this.tablename   = "schedule";
        this.tablenamesm = "日程";

        this.flowsetMap  = Rock.getMap(new String[]{
                "type", "行政",
                "sort", "31",
                "isxt", "2",
                "summary", "[{typename}]{title}",
                "imgurl","https://xinhu-1251238447.file.myqcloud.com/img/1045.png",
                "istj","1"
        });
        this.addfields("title", "varchar(100)", "", "标题", new String[]{
                "isbt","1",
                "isss","1",
                "isalign","1"
        });
        this.addfields("typename", "varchar(50)", "", "分类", new String[]{
                "isbt","0",
                "isss","1",
        });
        this.addfields("typecolor", "varchar(50)", "", "颜色@@rgb颜色红色如red", new String[]{
                "isbt","0",
                "isss","0",
        });
        this.addfields("recename", "varchar(1000)", "", "安排给@receid@不选默认安排给自己", new String[]{
                "isss","1",
                "fieldstype","changedeptusercheck",
        });
        this.addfields("receid", "varchar(1000)", "", "安排给人员ID", new String[]{
                "islu","0",
                "islb","0",
        });
        this.addfields("optname", "varchar(100)", "", "操作人", new String[]{
                "islu","0",
                "isss","1",
        });
        this.addfields("cid", "int(11)", "0", "对应单位", new String[]{
                "islu","0",
                "islb","0",
                "notelement","1"
        });
        this.addfields("aid", "int(11)", "0", "发布人ID", new String[]{
                "islu","0",
                "islb","0",
                "notelement","1"
        });
        this.addfields("explain", "varchar(500)", "", "说明", new String[]{
                "islb","1",
                "fieldstype","textarea",
                "isalign","1"
        });
        this.addfields("ratecont", "varchar(500)", "", "重复情况", new String[]{
                "islu","0",
                "isalign","1"
        });
        this.addfields("optdt", "datetime", null, "操作时间", new String[]{
                "islu","0",
                "islb","0",
        });
        this.addfields("startdt", "datetime", null, "开始时间@@可不设置", new String[]{
                "islb","1",
                "isbt","0",
                "devval","{now}"
        });
        this.addfields("filecont", "varchar(200)", "", "相关文件", new String[]{
                "islb","0",
                "fieldstype","uploadfile"
        });
        this.addfields("cid", "KEY", "`cid`", "单位ID");
        this.addfields("aid", "KEY", "`aid`", "创建人");


        //{receid,字段},{join,字段}
        this.addWhere("安排给我的", "my", "{receidnot}", "wtype=1");
        this.addWhere("我创建的", "mycj", "`aid`={aid}", "wtype=2");
        this.addWhere("提醒对应人", "mytodo", "", "islb=0");
        this.addWhere("自己创建可删", "mydel", "`aid`={aid}", "islb=0,wtype=3");
        this.addWhere("所有记录", "all", "1=1", "pnum=all");

        //添加单据通知设置
        this.addFlowTodo(ModuleTodo.get("todo")
                .setName("{typename}")
                .setSummary("{title}")
                .setWherelx("mytodo")
                .setWherena("提醒对应人")
                .setActtype("turn,edit,finish")
                .setTofields("receid")
        );
    }

}
